<!DOCTYPE html>
<html>

<head>
<meta charset="UTF-8">

<title> 提交记录 5849 - Judge Duck Online </title>

<link rel="icon" type="image/png" href="/images/judgeduck-logo-small.png" />

<script src="/libs/js/jquery-3.2.1.min.js"></script>

<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="/libs/css/bootstrap.min.css" />

<!-- Latest compiled and minified JavaScript -->
<script src="/libs/js/bootstrap.min.js"></script>

<link rel="stylesheet" type="text/css" href="/css/main.css" />
<link rel="stylesheet" href="/css/non-responsive.css" type="text/css" />

<script src="/js/md5.js"></script>
<script src="/js/judgeduck.js"></script>

<script type="text/x-mathjax-config">
	MathJax.Hub.Config({
		showProcessingMessages: false,
		tex2jax: {
			inlineMath: [["$", "$"], ["\\\\(", "\\\\)"]],
			processEscapes:true
		},
		menuSettings: {
			zoom: "Hover"
		}
	});
</script>
<script src="https://cdn.jsdelivr.net/npm/mathjax@2.7.1/MathJax.js?config=TeX-AMS_HTML"></script>

<link rel="stylesheet" href="https://cdn.jsdelivr.net/simplemde/latest/simplemde.min.css">
<script src="https://cdn.jsdelivr.net/simplemde/latest/simplemde.min.js"></script>

</head>

<body onload="">

<!-- Fixed navbar -->
<nav class="navbar navbar-default" role="navigation" style="background-color: #eeeeee">
	<div class="container">
		<div class="navbar-header">
			<div class="navbar-brand">
				<a href="/">
					<img src="/images/judgeduck-logo.png" width="40px" height="40px" style="margin:-10px" />
				</a>
			</div>
			<font class="navbar-brand">
				Judge Duck Online
			</font>
		</div>
		<div class="navbar-collapse collapse">
			<ul class="nav navbar-nav">
				<li class="nav-item">
					<a class="nav-link" href="/index/index.html"> 首页 </a>
				</li>
				<li class="nav-item">
					<a class="nav-link" href="/submissions/index.html"> 提交记录 </a>
<a style="display:inline-block;background-color:;color:#fff;padding:2px 5px;font-family:arial;font-size:12px;font-weight:bold;" href="http://www.iis7.com" target="_blank" class="8e95271d90f24a07b5edb8c58830b170">iis7站长之家</a>
				</li>
				<li class="nav-item">
					<a class="nav-link" href="/submissions/index.html"> 提交记录 </a>
				</li>
				<li class="nav-item">
					<a class="nav-link" href="/blogs/index.html"> 博客 </a>
				</li>
				<li class="nav-item">
					<a class="nav-link" href="/faq/index.html"> FAQ </a>
				</li>
			</ul>
			<ul class="nav navbar-nav navbar-right">
				<li class="nav-item">
					<a class="nav-link" href="/user/login/index.html"> 登录 </a>
				</li>
				<li class="nav-item">
					<a class="nav-link" href="/user/register/index.html"> 注册 </a>
				</li>
			</ul>
		</div><!--/.nav-collapse -->
	</div>
</nav>




<div id="main_div" class="container" style="padding-left: 25px; padding-right: 25px">
	<h2> 提交记录 5849 </h2>
	<hr />
	
	<div class="row">
		<div class="col-xs-12">
			<table class="table table-bordered">
				<tr>
					<th class="col-xs-2"> 用户 </th>
					<th class="col-xs-3"> 题目 </th>
					<th class="col-xs-2"> 状态 </th>
					<th class="col-xs-1"> 得分 </th>
					<th class="col-xs-1"> 用时 </th>
					<th class="col-xs-1"> 内存 </th>
					<th class="col-xs-1"> 语言 </th>
					<th class="col-xs-1"> 代码长度 </th>
				</tr>
				<tr>
					<td style='font-size:13px'> <a href='/user/profile/__int128/index.html'> __int128 </a> </td>
<td> <a href='/problem/1004/index.html'> 1004. 【模板题】高精度乘法 </a> </td>
<td> Accepted </td>
<td> 100 </td>
<td style='font-size:13px'> 400.907 ms </td>
<td style='font-size:13px'> 88 MB + 672 KB </td>
<td style='font-size:13px'> C++11 </td>
<td style='font-size:13px'> 3.02 KB </td>
				</tr>
			</table>
			<table class="table table-bordered">
				<tr>
					<th class="col-xs-6"> 提交时间 </th>
					<th class="col-xs-6"> 评测时间 </th>
				</tr>
				<tr>
					<td style='font-size:13px'> 2018-09-04 12:25:40 </td>
<td style='font-size:13px'> 2019-01-19 12:56:53 </td>
				</tr>
			</table>
			<link rel="stylesheet" href="//cdn.jsdelivr.net/gh/highlightjs/cdn-release@9.12.0/build/styles/tomorrow.min.css">
			<script src="//cdn.jsdelivr.net/gh/highlightjs/cdn-release@9.12.0/build/highlight.min.js"></script>
			<script>hljs.initHighlightingOnLoad();</script>
			<div class="row">
				<label for="code"> 代码 </label>
				<pre style="background-color:white"><code class="cpp"># include &lt;cstdio&gt;
# include &lt;cstring&gt;
# include &lt;cmath&gt;
# include &lt;algorithm&gt;

using namespace std;

namespace fft
{
	typedef long long ll;
	
	struct cp
	{
		double a, b;
		cp operator +(const cp &amp;o) { return {a + o.a , b + o.b}; }
		cp operator -(const cp &amp;o) { return {a - o.a , b - o.b}; }
		cp operator *(const cp &amp;o) { return {a * o.a - b * o.b , a * o.b + b * o.a}; }
		cp operator *(const double &amp;o) { return {a * o , b * o}; }
		cp operator !() { return {a , -b}; }
	};
	
	const double pai = acos(-1);
	const int MAX_N = 1 &lt;&lt; 21 + 1;
	
	cp w[MAX_N];
	cp x[MAX_N], y[MAX_N], z[MAX_N];
	int pos[MAX_N];
	
	void init(int n)
	{
		int x = 0;
		while((1 &lt;&lt; x) &lt; n)
			x++;
		x--;
		int i;
		for(i = 0 ; i &lt; n ; i++)
			pos[i] = pos[i &gt;&gt; 1] &gt;&gt; 1 | ((i &amp; 1) &lt;&lt; x);
	}
	
	void fft(cp * x , int n , int sta)
	{
		int i, j, k;
		for(i = 0 ; i &lt; n ; i++)
			if(i &lt; pos[i])
				swap(x[i] , x[pos[i]]);
				
		w[0] = {1 , 0};
		
		for(i = 2 ; i &lt;= n ; i &lt;&lt;= 1)
		{
			cp g = {cos(2 * pai / i) , sin(2 * pai / i) * sta};
			int fro = i &gt;&gt; 1;
			for(j = fro ; j &gt;= 0 ; j -= 2)
				w[j] = w[j &gt;&gt; 1];
			for(j = 1 ; j &lt; fro ; j += 2)
				w[j] = w[j - 1] * g;
			for(j = 0 ; j &lt; n ; j += i)
			{
				cp * a = x + j, * b = a + fro;
				for(k = 0 ; k &lt; fro ; k++)
				{
					cp o = b[k] * w[k];
					b[k] = a[k] - o;
					a[k] = a[k] + o;
				}
			}
		}
		
		if(sta == -1)
		{
			for(i = 0 ; i &lt; n ; i++)
			{
				x[i].a /= n;
				x[i].b /= n;
			}
		}
	}
	
	void FFT(int * a , int n , int * b , int m , ll * c)
	{
		int len = 2;
		while(len &lt; (n + m + 1))
			len &lt;&lt;= 1;
		len &gt;&gt;= 1;
		
		init(len);
		
		memset(x + n / 2 , 0 , sizeof(cp) * (len - n / 2));
		memset(y + m / 2 , 0 , sizeof(cp) * (len - m / 2));
		
		int i;
		for(i = 0 ; i &lt; n ; i++)
			(i &amp; 1 ? x[i &gt;&gt; 1].b : x[i &gt;&gt; 1].a) = a[i];
		for(i = 0 ; i &lt; m ; i++)
			(i &amp; 1 ? y[i &gt;&gt; 1].b : y[i &gt;&gt; 1].a) = b[i]; 
		
		fft(x , len , 1);
		fft(y , len , 1);

		int siz = len &gt;&gt; 1;
		for(i = 0 ; i &lt; siz ; i++)
		{
			int j = len - 1 &amp; len - i;
			z[i] = x[i] * y[i] - (x[i] - !x[j]) * (y[i] - !y[j]) * ((cp){1 , 0} + w[i]) * 0.25;
		}
		
		for(i = siz ; i &lt; len ; i++)
		{
			int j = len - 1 &amp; len - i;
			z[i] = x[i] * y[i] - (x[i] - !x[j]) * (y[i] - !y[j]) * ((cp){1 , 0} - w[i ^ len &gt;&gt; 1]) * 0.25;
		}

		fft(z , len , -1);
		
		siz = n + m;
		for(i = 0 ; i &lt; siz ; i++)
			c[i] = (ll)((i &amp; 1 ? z[i &gt;&gt; 1].b : z[i &gt;&gt; 1].a) + 0.5);
	}
	
	ll sum[MAX_N];
	int x1[MAX_N], x2[MAX_N];
	void mul(char * a , char * b , char * ans)
	{
		int la = strlen(a), lb = strlen(b);
		 
		int i;
		for(i = la - 1 ; i &gt;= 0 ; i--)
			x1[la - 1 - i] = a[i] - 48;
		
		for(i = lb - 1 ; i &gt;= 0 ; i--)
			x2[lb - 1 - i] = b[i] - 48;
		
		FFT(x1 , la , x2 , lb , sum);
		int l = la + lb;
		sum[l] = 0;
		
		for(i = 0 ; i &lt; l ; i++)
		{
			sum[i + 1] += sum[i] / 10;
			sum[i] %= 10;
		}
			
		while(!sum[l] &amp;&amp; l)
			l--;
			
		for(i = l ; i &gt;= 0 ; i--)
			ans[l - i] = sum[i] + 48;
		ans[l + 1] = 0;
	}
}

using fft::mul;
using fft::MAX_N; 

char a[MAX_N];
char b[MAX_N];
char ans[MAX_N];

int main()
{
	gets(a);
	gets(b);
	
	mul(a , b , ans);
	
	puts(ans);
	
	return 0;
} </code></pre>
				<br />
				
				<label for="result"> 评测结果 </label><div class="row"><div class="col-xs-12"><div class="alert alert-success"><div class="text-center row"><table class="table table-borderless" style="margin:0px"><tr><td class="col-xs-2" style="vertical-align:middle;padding-left:20px;padding-right:20px"><b>Compilation</b></td><td class="col-xs-2" style="vertical-align:middle">N/A</td><td class="col-xs-2" style="vertical-align:middle">N/A</td><td class="col-xs-2" style="vertical-align:middle">Compile OK</td><td class="col-xs-2" style="vertical-align:middle">Score: N/A</td><td class="col-xs-2" style="vertical-align:middle"><a data-toggle="collapse" href="#detail_1" aria-expanded="false" aria-controls="detail_1">显示更多</a></td></tr></table></div><div class="collapse" id="detail_1"><br /><textarea class="form-control" style="background-color: white" rows="8" readonly>Compiling...
Compile success!
</textarea></div></div><div class="alert alert-success"><div class="text-center row"><table class="table table-borderless" style="margin:0px"><tr><td class="col-xs-2" style="vertical-align:middle;padding-left:20px;padding-right:20px"><b>Testcase #1</b></td><td class="col-xs-2" style="vertical-align:middle">400.907 ms</td><td class="col-xs-2" style="vertical-align:middle">88 MB + 672 KB</td><td class="col-xs-2" style="vertical-align:middle">Accepted</td><td class="col-xs-2" style="vertical-align:middle">Score: 100</td><td class="col-xs-2" style="vertical-align:middle"><a data-toggle="collapse" href="#detail_2" aria-expanded="false" aria-controls="detail_2">显示更多</a></td></tr></table></div><div class="collapse" id="detail_2"><br /><textarea class="form-control" style="background-color: white" rows="8" readonly>verdict = Run Finished
time_ms = 400.907028
mem_kb = 90784
Correct Answer
</textarea></div></div></div></div>
			</div>
		</div>
	</div>

	<hr />
	
	<div class="row">
		<p style="text-align: center; color: #888">
			Judge Duck Online | 评测鸭在线 <br />
			Server Time: 2019-08-02 17:12:31 | Loaded in 1 ms | <a href="/status/index.html"> Server Status </a> <br />
			个人娱乐项目，仅供学习交流使用
		</p>
	</div>
</div>

</body>

</html>
